/** Component: Sidebar / Menu */
@use './mixins' as *;

$selector-color-mode-toggle-button: 'button[class*="ColorModeToggle"]';
$selector-color-mode-toggle-wrapper: 'div[class*="ColorModeToggle"]';

:root body {
  --doc-sidebar-width: 280px;
}

.navbar-sidebar {
  --ifm-navbar-background-color: var(--strapi-neutral-0);

  &__brand {
    --custom-navbar-sidebar-horizontal-padding: calc(var(--custom-navbar-items-gap) * 2);
    --ifm-navbar-padding-horizontal:
      var(--custom-navbar-items-gap)
      var(--ifm-navbar-padding-vertical)
      var(--custom-navbar-sidebar-horizontal-padding)
    ;
  }

  &__back {
    --ifm-menu-color-background-active: var(--strapi-neutral-100);
    top: -0.95rem;
    margin-bottom: -0.45rem;
  }

  .navbar__brand {
    flex-grow: 1;
  }

  .navbar-sidebar__close,
  #{$selector-color-mode-toggle-wrapper} {
    display: flex;
  }

  .navbar-sidebar__close {
    margin-left: initial;
    padding: 9px;
  }

  #{$selector-color-mode-toggle-wrapper} {
    margin-right: 0 !important;
  }
}

.menu {
  --custom-sidebar-caret-size: 1.25rem;
  --custom-sidebar-menu-font-weight: 400;
  --custom-sidebar-menu-padding-y: var(--strapi-spacing-4);

  --ifm-menu-color-background-active: transparent;
  --ifm-menu-color-background-hover: transparent;
  --ifm-menu-link-padding-vertical: var(--strapi-spacing-1);
  --ifm-menu-link-padding-horizontal: 0;

  font-weight: var(--custom-sidebar-menu-font-weight);
  padding-top: 4px;
  padding-left: 14px;
  padding-right: 2px;

  &.thin-scrollbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  &__caret {
    margin: 0 0 0 3px;
    padding: 0;

    &:before {
      background-size: var(--custom-sidebar-caret-size);
    }
  }

  &__caret,
  &__caret:before,
  &__link--sublist-caret::after,
  &__list-item-collapsible .menu__link--sublist-caret::after {
    background: var(--ifm-menu-link-sublist-icon) 50% / 1.25rem 1.25rem;;
    height: 16px;
    width: 16px;
  }

  .menu__list-item-collapsible {
    a {
      color: var(--strapi-neutral-600);
    }

    button.clean-btn.menu__caret {
      position: inherit;
      top: 5px;
    }
  }

  &__list {
    padding-left: 0;

    .menu__list,
    .theme-doc-sidebar-item-link,
    .theme-doc-sidebar-item-link a {
      padding-left: 0;
      padding-right: 4px;
    }

    .theme-doc-sidebar-item-category {
      padding-right: 4px;

      &-level-1 > .menu__list-item-collapsible > .menu__link {
        font-weight: bold;
      }
    }

    &-item {
      font-size: var(--custom-sidebar-menu-list-item-font-size, --strapi-font-size-sm);
      line-height: var(--strapi-line-height-sm);
      padding: 2px 10px 2px 0;

      &-collapsible {
        &:hover {
          background-color: var(--ifm-menu-color-background-hover);
        }
      }
    }

    .theme-doc-sidebar-item-link:has(.menu__link--active) {
      background-color: var(--strapi-primary-100);
      border-radius: 4px;
    }
  }

  &__link {
    min-height: var(--custom-menu-item-link-min-height, 24px);
    @include transition;

    &:hover {
      background-color: transparent;
      color: var(--strapi-primary-600);
    }

    &--sublist-caret {
      --ifm-menu-color: var(--strapi-neutral-800);
      --ifm-menu-color-active: var(--strapi-neutral-800);

      &:after {
        // display: none;
      }
    }

    &--sublist {
      &.menu__link--with-badge {
        --custom-menu-link-content-mw: calc(100% - 84px);
      }
    }

    &--with-badge {
      max-width: 100%;

      .menu__link__content {
        max-width: var(--custom-menu-link-content-mw, calc(100% - 56px));
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }

  &__link__content {
    padding-right: 10px;
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
  }

  .badge {
    margin: -1px 0 -1px auto;
  }

  .theme-doc-sidebar {
    &-item {
      &-category {
        &-level-1 {
          --custom-sidebar-menu-list-item-py: var(--strapi-spacing-1);

          padding-top: var(--custom-sidebar-menu-list-item-py);
          padding-bottom: var(--custom-sidebar-menu-list-item-py);
          padding-bottom: 20px;

          > .menu__list-item-collapsible {
            // font-weight: 700;
            font-size: var(--strapi-font-size-sm);

            > a.menu__link,
            a.menu__link--active {
              color: var(--strapi-neutral-500);
            }
          }
        }

        &-level-2 ul {
          padding-left: 10px;

          a {
            padding-left: 10px;
          }
        }

        &-level-3 ul {
          padding-left: 20px;

          a {
            padding-left: 10px;
          }
        }
      }

      &-category, &-link {
        &-level {
          &-1 {
            --custom-sidebar-menu-list-item-font-size: var(--strapi-font-size-sm);
          }

          &-2 {
            --custom-sidebar-menu-list-item-font-size: var(--strapi-font-size-sm); // next levels will have this same value
            --custom-sidebar-menu-list-item-link-active-left: -30px;

            padding-left: 10px;
          }

          &-3 {
            --custom-sidebar-menu-list-item-link-active-left: -42px;
          }

          &-4 {
            --custom-sidebar-menu-list-item-link-active-left: -54px;
          }

          &-5 {
            --custom-sidebar-menu-list-item-link-active-left: -66px;
          }
        }
      }

      &-link:hover {
        color: var(--strapi-primary-600);
      }
    }

    &-menu {
      .theme-doc-sidebar-item-category-level-1 > .menu__list-item-collapsible {
        padding-left: 10px;
        background-color: transparent;
        text-transform: uppercase;
        font-size: var(--strapi-font-size-xs);
        color: var(--strapi-neutral-500);
        font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        font-weight: 500;

        a::before {
          font-family: "Phosphor";
          display: inline-block;
          color: var(--strapi-neutral-500);
          margin-right: 8px;
          font-size: var(--strapi-font-size-md);
          // TODO: use fill version
        }
      /**
       * Note: The pointer-events: none declarations below are used to
       * disabling click on categories, but we need to keep the link for the breadcrumbs
       */
      /**
       * Custom icons for categories
       * Using https://phosphoricons.com
       */
      }
      /**
       * CMS docs categories icons
       */
      .theme-doc-sidebar-item-category-level-1.category-cms-getting-started > .menu__list-item-collapsible a {
        &::before {
          content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224Zm71.62-68.17-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83Zm-139.23,34Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM140,100a12,12,0,1,0-12,12A12,12,0,0,0,140,100Zm68,52.36-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z'/></svg>");
          position: relative;
          top: 2px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-features > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: '\E922';
          position: relative;
          top: -2px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-configurations > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: '\E87C';
          position: relative;
          top: -2px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-development > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: '\E586';
          position: relative;
          top: -2px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-typescript > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: '\E914';
          position: relative;
          top: -1px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-plugins > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M165.78,224H208a16,16,0,0,0,16-16V170.35A8,8,0,0,0,212.94,163a23.37,23.37,0,0,1-8.94,1.77c-13.23,0-24-11.1-24-24.73s10.77-24.73,24-24.73a23.37,23.37,0,0,1,8.94,1.77A8,8,0,0,0,224,109.65V72a16,16,0,0,0-16-16H171.78a35.36,35.36,0,0,0,.22-4,36,36,0,0,0-72,0,35.36,35.36,0,0,0,.22,4H64A16,16,0,0,0,48,72v32.22a35.36,35.36,0,0,0-4-.22,36,36,0,0,0,0,72,35.36,35.36,0,0,0,4-.22V208a16,16,0,0,0,16,16h42.22'></path></svg>");
          position: relative;
          top: 0px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-cli > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: '\EAE8';
          position: relative;
          top: -1px;
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-api > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><rect width='16' height='16' fill='rgb(142,142,169)'/><path d='M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,120,47.65,76,128,32l80.35,44Zm8,99.64V133.83l80-43.78v85.76Z'/></svg>");
        }
      }
      .theme-doc-sidebar-item-category-level-1.category-cms-upgrade > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><rect width='16' height='16' fill='rgb(142,142,169)'/><path d='M240,56V96a16,16,0,0,1-16,16H187.5L93.88,213.43A8,8,0,0,1,88,216H32a16,16,0,0,1-16-16V160a16,16,0,0,1,16-16H68.5L162.12,42.57A8,8,0,0,1,168,40h56A16,16,0,0,1,240,56Zm-34.34,90.34a8,8,0,0,0-11.32,0l-24,24a8,8,0,0,0,11.32,11.32L192,171.31V208a8,8,0,0,0,16,0V171.31l10.34,10.35a8,8,0,0,0,11.32-11.32Z'/></svg>");
        }
      }
      /**
       * Cloud docs categories icons
       */
      .theme-doc-sidebar-item-category-level-1.category-cloud-getting-started > .menu__list-item-collapsible a {
        pointer-events: none;
        &::before {
          content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M152,224a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,224Zm71.62-68.17-12.36,55.63a16,16,0,0,1-25.51,9.11L158.51,200h-61L70.25,220.57a16,16,0,0,1-25.51-9.11L32.38,155.83a16.09,16.09,0,0,1,3.32-13.71l28.56-34.26a123.07,123.07,0,0,1,8.57-36.67c12.9-32.34,36-52.63,45.37-59.85a16,16,0,0,1,19.6,0c9.34,7.22,32.47,27.51,45.37,59.85a123.07,123.07,0,0,1,8.57,36.67l28.56,34.26A16.09,16.09,0,0,1,223.62,155.83Zm-139.23,34Q68.28,160.5,64.83,132.16L48,152.36,60.36,208l.18-.13ZM140,100a12,12,0,1,0-12,12A12,12,0,0,0,140,100Zm68,52.36-16.83-20.2q-3.42,28.28-19.56,57.69l23.85,18,.18.13Z'/></svg>");
          position: relative;
          top: 2px;
        }
       }
       .theme-doc-sidebar-item-category-level-1.category-cloud-projects > .menu__list-item-collapsible a {
          pointer-events: none;
          &::before {
            content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M224,64H154.67L126.93,43.2a16.12,16.12,0,0,0-9.6-3.2H72A16,16,0,0,0,56,56V72H40A16,16,0,0,0,24,88V200a16,16,0,0,0,16,16H192.89A15.13,15.13,0,0,0,208,200.89V184h16.89A15.13,15.13,0,0,0,240,168.89V80A16,16,0,0,0,224,64Zm0,104H208V112a16,16,0,0,0-16-16H122.67L94.93,75.2a16.12,16.12,0,0,0-9.6-3.2H72V56h45.33L147.2,78.4A8,8,0,0,0,152,80h72Z'/></svg>");
            position: relative;
            top: 1px;
          }
        }
        .theme-doc-sidebar-item-category-level-1.category-cloud-deployments > .menu__list-item-collapsible a {
          pointer-events: none;
          &::before {
            content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M248,160a48.05,48.05,0,0,1-48,48H152c-17.65,0-32-14.75-32-32.89s14.35-32.89,32-32.89a31,31,0,0,1,3.34.18A48,48,0,0,1,248,160ZM112,72a87.57,87.57,0,0,1,61.35,24.91A8,8,0,0,0,184.5,85.44A104,104,0,0,0,8,160v16a8,8,0,0,0,16,0V160A88.1,88.1,0,0,1,112,72Zm0,32a55.58,55.58,0,0,1,33.13,10.84A8,8,0,1,0,154.6,102,72,72,0,0,0,40,160v16a8,8,0,0,0,16,0V160A56.06,56.06,0,0,1,112,104Zm15.21,26.71a8,8,0,0,0-5.94-9.63A40,40,0,0,0,72,160v16a8,8,0,0,0,16,0V160a24,24,0,0,1,29.57-23.35A8,8,0,0,0,127.21,130.71Z'/></svg>");
            position: relative;
            top: 1px;
          }
        }
        .theme-doc-sidebar-item-category-level-1.category-cloud-account > .menu__list-item-collapsible a {
          pointer-events: none;
          &::before {
            content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M172,120a44,44,0,1,1-44-44A44.05,44.05,0,0,1,172,120Zm60,8A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88.09,88.09,0,0,0-91.47-87.93C77.43,41.89,39.87,81.12,40,128.25a87.65,87.65,0,0,0,22.24,58.16A79.71,79.71,0,0,1,84,165.1a4,4,0,0,1,4.83.32,59.83,59.83,0,0,0,78.28,0,4,4,0,0,1,4.83-.32,79.71,79.71,0,0,1,21.79,21.31A87.62,87.62,0,0,0,216,128Z'/></svg>");
            position: relative;
            top: 1px;
          }
        }
        .theme-doc-sidebar-item-category-level-1.category-cloud-cli > .menu__list-item-collapsible a {
          pointer-events: none;
          &::before {
            content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgb(142,142,169)' viewBox='0 0 256 256'><path d='M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM77.66,173.66a8,8,0,0,1-11.32-11.32L100.69,128,66.34,93.66A8,8,0,0,1,77.66,82.34l40,40a8,8,0,0,1,0,11.32ZM192,176H128a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z'/></svg>");
            position: relative;
            top: 1px;
          }
        }
        .theme-doc-sidebar-item-category-level-1.category-cloud-configurations > .menu__list-item-collapsible a {
          pointer-events: none;
          &::before {
            content: '\E87C';
            position: relative;
            top: -1px;
          }
        }
      }
    }
  }

@include medium-up {
  .theme-doc-sidebar-container {
    --docusaurus-collapse-button-bg: var(--strapi-neutral-0);
    --docusaurus-collapse-button-bg-hover: var(--strapi-primary-100);
    position: sticky;
    top: 12px;
    height: calc(100vh + 180px);
  }

  .theme-doc-sidebar-menu.menu__list {
    margin-bottom: 80px;
  }

  @include medium-up {
    [class*="collapseSidebar"]::after,
    [class*="expandButton"]::after {
        font-family: "Phosphor";
        position: relative;
        top: 0;
        left: 0;
        color: var(--strapi-neutral-600);
        font-weight: 500;
    }

    [class*="collapseSidebar"] {
      border-bottom: none;
      min-height: 38px;

      &::after {
        content:'\E128';
      }
    }
    [class*="collapseSidebarButtonIcon"] {
      display: none;
    }
    [class*="expandButton"] {
      svg {
        display: none;
      }
      &::after {
        content:'\E12A';
      }
    }
  }
}

/** Dark mode */
@include dark {
  --ifm-menu-color: var(--strapi-neutral-1000);

  .theme-doc-sidebar-container {
    .menu {
      --ifm-menu-color-background-hover: var(--strapi-neutral-100);

      &__link--active {
        --ifm-menu-color-active: var(--strapi-neutral-800);

        &:not(.menu__link--sublist) {
          --ifm-menu-color-active: var(--strapi-primary-500);
        }
      }

      &__list-item-collapsible .menu__link {
        color: var(--strapi-neutral-700);
      }
    }
  }
}

// Regular tooltips for sidebar links
.menu__link__content:hover .info-icon__tooltip,
.menu__link--sublist:hover .info-icon__tooltip {
  visibility: visible;
  opacity: 1; 
}

.menu__link--sublist .strapi-icons,
.menu__link__content .strapi-icons {
  margin-left: 8px;
  cursor: help;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  
  &__tooltip {
    --custom-tooltip-width: 220px;
    font-size: 12px;
    visibility: hidden;
    width: var(--custom-tooltip-width);
    background-color: var(--strapi-neutral-100);
    color: var(--strapi-neutral-700);
    text-align: left;
    border-radius: 6px;
    padding: 14px 14px 0;
    position: absolute;
    z-index: 99999;
    top: 24px;
    width: 100%;
    min-height: 60px;
    transform: (100%);
    left: 0;
    font-size: var(--strapi-font-size-xs);
    line-height: var(--strapi-line-height-xxs);
    border: 1px solid var(--strapi-neutral-200);
    box-shadow: 0 4px 12px rgba(33, 33, 52, 0.15);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding-bottom: 1rem;

    div {
      margin-top: 1rem;
    }
    
    ul, ol {
      margin: 4px 0;
      padding-left: 14px;
      margin-left: 6px;
    }
    
    li {
      margin: 2px 0 8px;
    }
    
    a {
      color: var(--strapi-primary-600);
      text-decoration: underline;
    }
    
    p {
      margin: 4px 0;
      
      &:first-child {
        margin-top: 0;
      }
      
      &:last-child {
        margin-bottom: 0;
      }
    }
    
    strong {
      font-weight: 600;
      color: var(--strapi-neutral-800);
    }
    
    code {
      background-color: var(--strapi-neutral-150);
      color: var(--strapi-neutral-700);
      padding: 2px 4px;
      border-radius: 3px;
      font-size: 11px;
    }
    
    .tooltip-arrow {
      position: absolute;
      top: -12px;
      left: 30px;
      width: 0;
      height: 0;
      
      &::before {
        content: "";
        position: absolute;
        top: -2px;
        left: -7px;
        width: 0;
        height: 0;
        border-width: 7px;
        border-style: solid;
        border-color: transparent transparent var(--strapi-neutral-200) transparent;
      }
      
      &::after {
        content: "";
        position: absolute;
        top: 1px;
        left: -6px;
        width: 0;
        height: 0;
        border-width: 6px;
        border-style: solid;
        border-color: transparent transparent var(--strapi-neutral-100) transparent;
      }
    }
  }
}

// Display tooltip while hovering the whole li element for menu links
.theme-doc-sidebar-item-link:hover .info-icon__tooltip {
  visibility: visible;
  opacity: 1;
}

// Expendable notice that can be used instead of tooltips
.sidebar-notice {
  background-color: var(--strapi-neutral-100);
  border-radius: 6px;
  border: 1px solid var(--strapi-neutral-200);
  font-size: 12px;
  line-height: 1.4;
  position: relative;
  transition: all 0.3s ease;
  cursor: help;
  color: var(--strapi-neutral-700);
  
  &:hover {
    .sidebar-notice__header {
      background-color: var(--strapi-neutral-200);
    }
  }

  &__header {
    padding: 6px 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;

    &::after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 6px;
      background-color: var(--strapi-neutral-200);
      visibility: hidden;
      z-index: 9999;
    }
  }

  .strapi-icons {
    color: var(--strapi-neutral-600);
    font-size: 13px;
    flex-shrink: 0;
    top: -1px;
    position: relative;
  }

  &__content {
    color: var(--strapi-neutral-700);
    flex: 1;
    
    a {
      color: var(--strapi-primary-600);
      text-decoration: none;
      
      &:hover {
        text-decoration: underline;
      }
    }
  }
  
  &__toggle {
    background: none;
    border: none;
    padding: 2px;
    color: var(--strapi-neutral-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    
    &:hover {
      color: var(--strapi-primary-600);
    }
    
    .strapi-icons {
      font-size: 12px;
    }
  }
  
  &__expandable {
    position: absolute;
    top: calc(100% - 3px);
    left: -1px;
    right: -1px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background-color: var(--strapi-neutral-100);
    border: 1px solid var(--strapi-neutral-200);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 9998;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 14px 10px 0 !important;
    padding-bottom: 1rem !important;
    
    &--visible {
      max-height: 300px;
      opacity: 1;
      padding: 8px;
      box-shadow: 0 4px 12px rgba(33, 33, 52, 0.15);
    }

    a {
      padding-left: 0 !important;
    }

    &::before {
      content: "";
      position: absolute;
      background-color: var(--strapi-neutral-100);
      width: 100%;
      height: 4px;
      top: 0;
      left: 0;
    }
    
    // Support HTML content
    ul, ol {
      margin: 4px 0;
      padding-left: 14px;
    }
    
    li {
      margin: 2px 0;
      list-style-type: disc;
    }
    
    a {
      color: var(--strapi-primary-600);
      text-decoration: none;
      
      &:hover {
        text-decoration: underline;
      }
    }
    
    p {
      margin: 4px 0;
      
      &:first-child {
        margin-top: 0;
      }
      
      &:last-child {
        margin-bottom: 0;
      }
    }
    
    strong {
      font-weight: 600;
      color: var(--strapi-neutral-800);
    }
    
    code {
      background-color: var(--strapi-neutral-150);
      color: var(--strapi-neutral-700);
      padding: 2px 4px;
      border-radius: 3px;
      font-size: 11px;
    }
  }
  
  &__badges {
    display: flex;
    gap: 4px;
    padding: 0 8px 6px 8px;
  }
  
  // Hover state to trigger expandable content
  &:hover {
    .sidebar-notice__header {
      border-radius: 6px 6px 0 0;
      
      &::after {
        visibility: visible;
      }
    }
    
    .sidebar-notice__expandable {
      max-height: 400px;
      opacity: 1;
      padding: 8px;
      box-shadow: 0 4px 12px rgba(33, 33, 52, 0.15);
    }
    
    .sidebar-notice__toggle {
      transform: rotate(90deg);
    }
  }
}

.sidebar-notice-item {
  margin: 6px 0;
}

// Dark mode for regular tooltips and notices
@include dark {
  .info-icon {
    &__icon {
      color: var(--strapi-neutral-400);
      
      &:hover {
        color: var(--strapi-primary-400);
      }
    }
    
    &__tooltip {
      background-color: var(--strapi-neutral-0);
      color: var(--strapi-neutral-700);
      border-color: var(--strapi-neutral-200);
      
      a {
        color: var(--strapi-primary-500);
      }
      
      strong {
        color: var(--strapi-neutral-700);
      }
      
      code {
        background-color: var(--strapi-neutral-100);
        color: var(--strapi-neutral-500);
      }
      
      .tooltip-arrow::after {
        border-color: transparent transparent var(--strapi-neutral-0) transparent;
      }
    }
  }
  
  .sidebar-notice {
    background-color: var(--strapi-neutral-100);
    border-color: var(--strapi-neutral-200);
    
    &:hover {
      .sidebar-notice__header {
        background-color: var(--strapi-neutral-150);

        &::after {
          background-color: var(--strapi-neutral-150);
        }
      }
    }

    .strapi-icons {
      color: var(--strapi-neutral-500);
    }
    
    &__content {
      color: var(--strapi-neutral-400);
      
      a {
        color: var(--strapi-primary-500);
      }
    }
    
    &__toggle {
      color: var(--strapi-neutral-500);
      
      &:hover {
        color: var(--strapi-primary-500);
      }
    }
    
    &__expandable {
      a {
        color: var(--strapi-primary-500);
      }
      
      li {
        color: var(--strapi-neutral-700);
      }
      
      strong {
        color: var(--strapi-neutral-800);
      }
      
      code {
        background-color: var(--strapi-neutral-100);
        color: var(--strapi-neutral-500);
      }
    }
  }
}